package bean;

import java.util.List;

public class JsonBean {
    //    "name": "zhangsan",
//            "age": 18,
//            "books":
    String name;
    int age;
    List<Book> books;

    @Override
    public String toString() {
        return "JsonBean{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", books=" + books +
                '}';
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public List<Book> getBooks() {
        return books;
    }

    public void setBooks(List<Book> books) {
        this.books = books;
    }

    /**
     * 静态内部类
     */
    public static class Book{
        //        "name": "java",
//                "author": "lisi"
        String name;
        String author;

        @Override
        public String toString() {
            return "Book{" +
                    "name='" + name + '\'' +
                    ", author='" + author + '\'' +
                    '}';
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getAuthor() {
            return author;
        }

        public void setAuthor(String author) {
            this.author = author;
        }
    }

}

